home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 10
/
FM Towns Free Software Collection 10.iso
/
ms_dos
/
tool
/
fapxtool
/
src
/
txl
/
txlswchk.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-11
|
2KB
|
110 lines
/***************
*
* g:\exe\txl\src\txlswchk.c
*/
#include "txl.h"
int chkoprnd(char next)
{
if (next == '-') return (0);
if (next == NUL) return (0);
return (1);
}
void swchk(int count, char *val[])
{
int i;
fpmes = fopen(val[0], "wt");
if (fpmes == NULL) {
fprintf(stderr, "Error:cannot open message file '%s'\n", val[0]);
Exit(1);
}
for (i = 1; i < count; i++) {
if (val[i][0] == '-') {
val[i][1] = tolower(val[i][1]);
val[i][2] = tolower(val[i][2]);
switch(val[i][1]) {
case 'b':
if (val[i][2] == 'c') {
bottomcut(&val[i+1]);
}
else if (val[i][2] == 'd') {
bottomdsp(&val[i+1], (int)(val[i][3] - '0'));
}
break;
case 'c':
if (val[i][2] == 'f') {
craftname(&val[i+1], craftfb);
}
else if (val[i][2] == 'b') {
craftname(&val[i+1], craftbf);
}
break;
case 'l':
if (val[i][2] == 'c') {
lcxdriver(&val[i+1]);
}
else if (val[i][2] == 'o') {
logdriver(&val[i+1]);
}
break;
case 'd':
if (val[i][2] == 'i') {
dirdriver(&val[i+1]);
}
else if (val[i][2] == 'l') {
dlldriver(&val[i+1]);
}
break;
case 'n':
if (val[i][2] == 'p') {
npcutdriver(&val[i+1]);
}
break;
case 'p':
if (val[i][2] == 'x') {
expand_passwd(&val[i+1]);
}
else if (val[i][2] == 'c') {
compress_passwd(&val[i+1]);
}
break;
case 'r':
if (val[i][2] == 't') {
rtndriver(&val[i+1]);
}
break;
case 's':
if (val[i][2] == 't') {
settime(val[i+1]);
Exit(0);
}
if (val[i][2] == 'd') {
setdate(val[i+1]);
Exit(0);
}
if (val[i][2] == 'x') {
settime(val[i+2]);
setdate(val[i+1]);
Exit(0);
}
break;
/*
default:
fprintf(stderr, "Warning:invailed parameter'%s'\n", val[i]);
*/
}
i++;
}
else {
if (strlen(val[i]) <= 12) {
strcpy(txfsetfile, val[i]);
}
}
}
errexit("effective parameter isn't specified.");
}